package ngames.com.sushitv.api;

import java.util.ArrayList;

import ngames.com.sushitv.entity.Anime;
import ngames.com.sushitv.entity.ButtonHome;
import ngames.com.sushitv.entity.FanMadeContent;
import ngames.com.sushitv.entity.ItemVideo;
import ngames.com.sushitv.entity.ResetPasswordInfo;
import ngames.com.sushitv.entity.SearchPrompt;
import ngames.com.sushitv.entity.UpUser;
import ngames.com.sushitv.entity.UserInfo;
import ngames.com.sushitv.net.okhttp.callback.RequestCallBack;
import ngames.com.sushitv.net.okhttp.callback.RequestCallBackJSON;

/**
 * Created by Jeffrey on 2016/7/26.
 */
public interface Api {
    public final static String HTTP_HOST = "http://60.191.1.98:9080/";//外网
    //  public final static String HTTP_HOST = "http://10.10.1.65:9080/v1/";//内网
    /**
     * 注册接口
     */
    public final static String URL_REGISTER = HTTP_HOST + "v1/user/register";
    /**
     * POST /v1/user/register-phone
     */
    public final static String URL_REGISTER_PHONE = HTTP_HOST + "v1/user/register-phone";

    /**
     * 登录
     */
    public final static String URL_LOGIN = HTTP_HOST + "v1/user/login";
    public final static String URL_LOGIN_FB = HTTP_HOST + "v1/user/login-fb";

    /**
     * 令牌刷新
     */
    public final static String URL_REFRESH_TOKEN = HTTP_HOST + "v1/user/refresh-token";

    /**
     * 忘记密码
     */
    public final static String URL_FORGOT = HTTP_HOST + "v1/user/forgot";
    public final static String URL_FORGOT_PHONE = HTTP_HOST + "v1/user/forgot-phone";

    /**
     * 手机重置密码
     */
    public final static String URL_RESET_PASSWORD = HTTP_HOST + "v1/user/reset";

    /**
     * 验证账户、email是否被注册
     */
    public final static String URL_ACCOUNT_EXISTS = HTTP_HOST + "v1/user/account-exists";

    /**
     * 发送验证码
     */
    public final static String URL_SEND_SMS = HTTP_HOST + "v1/user/send-sms";

//    /**
//     * 视频排行榜
//     */
//    public final static String URL_VIDEO_RANK = HTTP_HOST + "v1/video/rank?";

//    /**
//     * 取消请求
//     * @param urlTag
//     */
//    void cancelRequest(String urlTag);

    /**
     * POST /v1/user/login
     * 登录
     */
    void login(String type, String email, String area, String phone, String password, final RequestCallBack<UserInfo> listener);

    /**
     * POST /v1/user/login-fb
     * 登录
     */
    void loginFB(String fbID, String email, final RequestCallBack<UserInfo> listener);

    /**
     * POST /v1/user/register
     * 注册
     */
    void register(String type, String fbid, String fbemail, String fbavatar, String name, String email, String password, final RequestCallBack<UserInfo> listener);

    /**
     * POST /v1/user/register-phone
     */
    void registerPhone(String sms_key, String sms_code, String name, String password, String area, String phone, final RequestCallBack<UserInfo> listener);

    /**
     * POST /v1/user/refresh-token
     * 令牌刷新
     */
    void refreshToken(String refreshToken, final RequestCallBack<UserInfo> listener);

    /**
     * POST /v1/user/forgot
     * 忘记密码
     */
    void forgotPassword(String email, final RequestCallBack<Void> listener);
    void forgotPasswordPhone(String area, String phone, String sms_key, String sms_code, final RequestCallBack<ResetPasswordInfo> listener);

    /**
     * POST /v1/user/reset
     * 重置密码
     */
    void resetPassword(String area, String phone, String resetToken, String password, final RequestCallBack<Void> listener);

    /**
     * GET /v1/user/account-exists
     * 验证账户、email是否被注册
     */
    void isRegistered(String type, String value, final RequestCallBack<Void> listener);

    /**
     * POST /v1/user/send-sms
     * 发送验证码
     */
    void sendSms(String type, String phone, final RequestCallBack<String> listener);

//    /**
//     * 视频排行榜
//     */
//    void videoRank(String code, String size, RequestCallBack<ArrayList<ItemVideo>> listener);

    /**
     * 视频排行榜
     */
    public final static String URL_VIDEO_RANK = HTTP_HOST + "v1/video/rank?";
    /**
     * 视频分类
     * */
    public final static String URL_VIDEO_CATES = HTTP_HOST + "v1/video/cates?";
    /**
     * famade详情
     * */
    public final static String URL_VIDEO_FANMADE_CONTENT = HTTP_HOST+"v1/video/original-sub?";
    /**
     * 热搜词
     * */
    public final static String URL_SEARCH_HOT_WORD = HTTP_HOST+"v1/search/hot-word?";
    /**
     * 提示词
     * */
    public final static String URL_SEARCH_PROMPT = HTTP_HOST+"v1/search/prompt?";
    /**
     * 检索结果
     * */
    public final static String URL_SEARCH = HTTP_HOST+"v1/search?";
    /**
     * 视频详情
     * */
    public final static String URL_VIDEO_DETAILS=HTTP_HOST+"v1/video/play-info?";
    /**
     * 番剧详情
     * */
    public final static String URL_ANIME_DETAILS=HTTP_HOST+"v1/video/detail?";
    /**
     *
     * */
    public final static String URL_ITEMVIDEO=HTTP_HOST+"v1/user/favourites?";
    /**
     * 取消请求
     * @param urlTag
     */
    void cancelRequest(String urlTag);

    /**
     * 注册
     *
     * @param nickName
     * @param email
     * @param password
     * @param listener
     */
    //void register(String nickName, String email, String password, final RequestCallBack<UserInfo> listener);

    /**
     * 视频排行榜
     */
    void videoRank(String code, String size, RequestCallBack<ArrayList<ItemVideo>> listener);
    void videoRank(String id, RequestCallBackJSON<ArrayList<ItemVideo>> requestCallBackJSON);
    /**
     * 视频类型按钮
     * */
    void videoCates(RequestCallBack<ArrayList<ButtonHome>> listener);
    /**
     * 热词
     * */
    void hotWord(RequestCallBack<ArrayList<String>> listener);
    /**
     * 提示词
     * */
    //void searchPrompt(String word,RequestCallBack<ArrayList<SearchPrompt>> listener);
    void searchPrompt(String word,String key,RequestCallBack<ArrayList<String>> listener);
    /**
     * 搜索结果
     * */
    void searchRequest(String order,String type,String name,String page,RequestCallBack<ArrayList<Anime>> listener);
    /**
     * 用户搜索结果
     * */
    void searchUserRequest(String type, String name, String page, RequestCallBackJSON<ArrayList<UpUser>> listener);
    /**
     * 视频详情
     * */
    void videoDetails(String vsId,RequestCallBack<ArrayList<ItemVideo>> listener);
    /**
     * 番剧详情
     * */
    void animeDetails(String vId,RequestCallBack<ArrayList<ItemVideo>> listener);
    /**
     *
     * */
    void itemVideo(String id, int videoType, int total, int page,RequestCallBack<ArrayList<ItemVideo>> listener);
    /**
     * fanMadeFragment 下动态获取的列表
     * */
    //void videoContent(ArrayList<ButtonHome> data, RequestCallBack<ArrayList<FanMadeContent>> listener);


}
